#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int t,a,b;
	scanf("%d",&t);
	int i;
	for (i = 0; i < t; i++)
	{
		scanf("%d %d",&a,&b);
		if (a % b == 0||b==0)
			printf("NO\n");
		else
			printf("YES\n");
	}
}